package com.ruoyi.merchant.domain.dto;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 添加银行卡DTO
 */
@Data
public class AddBankCardDTO {
    
//    @ApiModelProperty(value = "银行名称", required = true, example = "中国工商银行")
    @NotBlank(message = "银行名称不能为空")
    private String bankName;
    
//    @ApiModelProperty(value = "银行编码", example = "ICBC")
    private String bankCode;
    
//    @ApiModelProperty(value = "开户支行名称", example = "北京朝阳支行")
    private String branchName;
    
//    @ApiModelProperty(value = "银行卡号", required = true, example = "6222021001234567890")
    @NotBlank(message = "银行卡号不能为空")
    @Pattern(regexp = "^\\d{16,19}$", message = "银行卡号格式不正确")
    private String cardNumber;
    
//    @ApiModelProperty(value = "持卡人姓名", required = true, example = "张三")
    @NotBlank(message = "持卡人姓名不能为空")
    private String cardHolderName;
    
//    @ApiModelProperty(value = "持卡人身份证号", required = true, example = "110101199001011234")
    @NotBlank(message = "持卡人身份证号不能为空")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$", 
             message = "身份证号格式不正确")
    private String cardHolderIdcard;
    
//    @ApiModelProperty(value = "持卡人预留手机号", required = true, example = "13800138000")
    @NotBlank(message = "预留手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String cardHolderPhone;
    
//    @ApiModelProperty(value = "卡片类型：1-借记卡，2-贷记卡，3-对公账户", required = true, example = "1")
    @NotNull(message = "卡片类型不能为空")
    private Integer cardType;
    
//    @ApiModelProperty(value = "是否设为默认卡", example = "true")
    private Boolean setAsDefault = false;
}
